<template>
	<view>
		<view class="list" v-for="(item,index) in list" :key="index">
			<view class="time flex align between">
				<view>申报时间：{{item.create_time}}</view>
				<view class="status">{{item.status_text}}</view>
			</view>
			<view style="border-bottom: solid 1rpx gainsboro;padding-bottom: 20rpx;">
				<view class="info flex align">
					<image style="margin-right: 20rpx;" src="/static/images/mine/head.png" class="head"></image>
					<view class="detail">
						<view class="name" style="margin-bottom: 10rpx;">{{item.realname}}（{{item.sex==1?'男':'女'}}）</view>
						<view class="flex align">
							<view class="phone">
								<image mode="widthFix" src="/static/images/icon1.png"></image>
								{{item.mobile}}
							</view>
							<view class="posi">
								<image mode="widthFix" src="/static/images/icon3.png"></image>
								{{item.industry_text}}
							</view>
						</view>
						<!-- <view class="posi">申报类型：流入申报</view> -->
						<view class="flex align" style="font-size: 24rpx;">
							<view style="color: #FF9008;">申报类型：</view>
							<view v-if="item.bjtype==1" style="font-weight: bold;">返乡申请</view>
							<view v-else>{{item.type==1?'流出申报':'流入申报'}}</view>
						</view>
						<view v-if="item.in_region_text!=''" class="flex align" style="font-size: 24rpx;">
							<view style="color: #FF9008;">流入地区：</view>
							<view>{{item.in_region_text}}</view>
							<view v-if="item.in_address!=''&&item.in_address!=null">{{item.in_address}}</view>
						</view>
						<view v-if="item.out_region_text!=''" class="flex align" style="font-size: 24rpx;">
							<view style="color: #FF9008;">流出地区：</view>
							<view>{{item.out_region_text}}</view>
						</view>
						<view v-if="item.remark!=''" class="flex align" style="font-size: 24rpx;">
							<view style="color: #FF9008;">备注：</view>
							<view>{{item.remark}}</view>
						</view>
					</view>
				</view>

			</view>
			<view class="flex align address" style="border-bottom: solid 1rpx gainsboro;">
				<view class="address-item">
					<view>流出党支部</view>
					<view>{{item.out_organization_text}}</view>
				</view>
				<image mode="widthFix" src="/static/images/icon2.png"></image>
				<view class="address-item">
					<view>流入党支部</view>
					<view>{{item.in_organization_text}}
					<text v-if="item.inorgname!=null&&item.inorgname!=''">（{{item.inorgname}}）</text>
					</view>
				</view>
			</view>

		</view>
		<!-- <uni-load-more :status="status" v-if="!empty" :content-text="loadText"></uni-load-more> -->
		<xw-empty :isShow="empty" text="暂无数据" textColor="#777777"></xw-empty>
	</view>
</template>

<script>
	import {
		applyList
	} from '@/api/apiData.js';
	export default {
		data() {
			return {
				totalPage: 1,
				page: 0,
				offset: 10,
				list: [],
				scrollTop: 0,
				empty: false,
				loadText: {
					loadmore: '点击或上拉加载更多',
					loading: '努力加载中',
					nomore: '实在没有了'
				},
				status: 'loadmore',
			};
		},
		onLoad() {
			this.getlist();
		},
		onPageScroll(e) {
			const that = this;
			that.scrollTop = e.scrollTop;
		},
		onReachBottom() {
			const that = this;
			that.getlist();
		},
		methods: {
			async getlist() {
				const that = this;
				const {
					totalPage,
					page,
					offset,
					list,
				} = that;

				let obj = {
					size: offset,
					page: page + 1,
				};
				that.status = 'loading';
				if (totalPage > page) {
					let result = await applyList(obj);
					if (result.code == 1) {
						that.page = page + 1;
						if (result.data.total == 0) {
							that.empty = true;
							that.status = 'nomore';
							return;
						}
						that.empty = false;
						setTimeout(() => {
							that.status = 'loadmore';
						}, 500);
						that.list = list.concat(result.data.list);
						that.totalPage = Math.ceil(result.data.total / offset);
					}
				} else {
					setTimeout(() => {
						that.status = 'nomore';
					}, 500);
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.list {
		background: white;
		padding: 0 17rpx;
		margin-top: 20rpx;

		.time {
			padding: 14rpx 0;
			font-size: 24rpx;
			border-bottom: solid 1rpx #EBEBEB;
		}

		.status {
			color: #FF9008;
		}

		.info {
			padding: 28rpx 20rpx 10rpx;

			.head {
				width: 116rpx;
				height: 116rpx;
				// margin-right: 26rpx;
			}

			.detail {
				width: 80%;

				image {
					width: 26rpx;
					height: 26rpx;
					margin-right: 6rpx;
				}
			}

			.phone {
				font-size: 24rpx;
				margin: 10rpx 0;
			}

			.posi {
				font-size: 24rpx;
				margin-left: 20rpx;
			}
		}

		.address {
			// margin-left: 86rpx;
			text-align: center;
			justify-content: center;
			padding: 20rpx 0;

			image {
				width: 40rpx;
				height: 24rpx;
				margin: 0 41rpx;
			}

			.address-item view:nth-child(1) {
				font-size: 24rpx;
			}

			.address-item view:nth-child(2) {
				font-size: 28rpx;
				color: #FF9008;
				margin-top: 8rpx;
			}
		}
	}
</style>